﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Chloe.Annotations;

namespace Kang.DbDoc.Domains
{
    public class DbTableColumn
    {
        [Column("table_name")]
        public string TableName { get; set; }

        [Column("table_type")]
        public string TableType { get; set; }

        [Column("table_comment")]
        public string TableComment { get; set; }

        /// <summary>
        /// 列名称
        /// </summary>
        [Column("column_name")]
        public string ColumnName { get; set; }

        /// <summary>
        /// 列注解
        /// </summary>
        [Column("column_comment")]
        public string ColumnComment { get; set; }

        /// <summary>
        /// 列类型
        /// </summary>
        [Column("column_type")]
        public string ColumnType { get; set; }

        /// <summary>
        /// 列长度
        /// </summary>
        [Column("column_length")]
        public long? ColumnLength { get; set; }

        /// <summary>
        /// 小数位数
        /// </summary>
        [Column("column_scale")]
        public int? ColumnScale { get; set; }

        /// <summary>
        /// 键值类型
        /// </summary>
        [Column("column_key_type")]
        public string ColumnKeyType { get; set; }

        /// <summary>
        /// 根据是否包含"auto_increment"判断是否自增
        /// </summary>
        [Column("column_extra")]
        public string ColumnExtra { get; set; }

        /// <summary>
        /// 是否为NULL
        /// </summary>
        [Column("column_null")]
        public string ColumnNull { get; set; }

        /// <summary>
        /// 默认值
        /// </summary>
        [Column("column_default")]
        public string ColumnDefault { get; set; }
    }
}
